{% extends "base.html" %}
{% load static %}

{% block content %}
    <h3> Add {{ product.name }} API Scan Configuration</h3>
    <form class="form-horizontal" method="post">{% csrf_token %}
        {% include "dojo/form_fields.html" with form=form %}
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-2">
                <input class="btn btn-primary" type="submit" name="add" value="Save"/>
            </div>
            <div class="col-sm-2">
                <input class="btn btn-primary" type="submit" name="add_another" value="Save &amp; Add Another"/>
            </div>
        </div>
    </form>
    <div class="alert alert-info">
        API Scan Configurations are supported for these test types.
        <ul>
        {% for hint in api_scan_configuration_hints %}
            <li>
                {% if hint.tool_types.count == 0 %}
                    <a id="link_tt_{{ hint.id }}" href="{% url 'add_tool_type' %}?name={{ hint.tool_type_name }}">Parser <b>{{ hint.name }}</b> requires created tool type <b>{{ hint.tool_type_name }}</b>.</a>
                {% elif hint.tool_configurations.count == 0 %}
                    <a id="link_tc_{{ hint.id }}" href="{% url 'add_tool_config' %}?tool_type={{ hint.tool_types.first.id }}">Tool type <b>{{ hint.tool_type_name }}</b> exists however parser <b>{{ hint.name }}</b> requires at least one tool configuration.</a>
                {% else %}
                    <b>{{ hint.name }}</b>: {{ hint.hint | safe }}
                {% endif %}
            </li>
        {% endfor %}
        </ul>
    </div>
{% endblock %}
{% block postscript %}
{% endblock %}
